<style>
    .radioBtn .allDeviceIP {
        background-image: url(/assets/images/unchecked.png);
    }

    .radioBtn .deviceIP {
        background-image: url(/assets/images/selected.png);
    }
</style>
<div class="bjui-row col-1 ">
    <label class="row-label">IP：</label>
    <div class="row-input required">
        <input type="text" id="deviceIP" name="sn" data-rule="required,ip">
    </div>
    <label class="row-label">例如：</label>
    <div class="row-input">
        <p style="line-height: 34px; color: #f96868;">198.168.1.1:6009</p>
    </div>
    <label class="row-label">所有设备IP：</label>
    <div class="row-input">
        <div class="radioBtn pr20">
            <div class="allDeviceIP"></div>
            <span>是</span>
        </div>
        <div class="radioBtn">
            <div class="deviceIP" checked="checked"></div>
            <span>否</span>
        </div>
    </div>
</div>

<div class="bjui-pageFooter">
    <ul>
        <li>
            <button type="button" class="btn-close" data-icon="close">取消</button>
        </li>
        <li>
            <button type="submit" class="btn-default " onclick="saveIpConfiguration()" data-icon="save">保存</button>
        </li>
    </ul>
</div>
<script type="text/javascript">
    var allDevicesIP;
    $(document).ready(function () {
        if ($(".pitchOn").attr("checked")) {
            allDevicesIP = 1;
        } else {
            allDevicesIP = 0;
        }

    })
    function saveIpConfiguration() {
        var objIP = new Object();
        objIP.netconfig = $("#deviceIP").val();
        objIP.allDevices = allDevicesIP;
        objIP.sn = snVal;
        $.ajax({
            type: "post",
            url: "/sysmanage/devicemonitor/deviceipConf.do",
            data: objIP,
            dataType: "json",
            success: function (data) {
                BJUI.alertmsg(data.Message, data.content);
            }
        })
    }
</script>